/**
 * @file:          StepperMotor.h
 * @brief:         
 * @details:       
 * @author:        wjh
 * @date created:  2023.06.09
 * @version:       1.0.0
 * @par copyright (c):
 *   
 * @par history (desc):
 *   version:1.0.0, wjh, 2023.06.09,18:31:37
 */
#ifndef _STEPPER_MOTOR_CONFIG_H_
#define _STEPPER_MOTOR_CONFIG_H_

/* Include Files **************************************************************/
#include "Datatype.h"


/* Macro Definition ***********************************************************/

/* Data Type Define ***********************************************************/
typedef struct StepperMotor
{
    /* public data */
    float32 param_R; /* unit: ohm */
    float32 param_L;/* unit: H */
    float32 param_Ke;/* unit: Vrms/(rad/s) */

    float32 param_Kt;/* unit: Nm/Arms */
    float32 param_mass;/* unit: kg */
    float32 param_J;/* moment_of_inertia, unit: kg*m^2 */
    float32 param_B;/* viscous damping coefficient, unit: kg*m^2 */

    float32 param_stepping_angle_degree;
    float32 param_phase_nums;
    uint16 param_pole_pair;
    
    float32 param_power_supply;/* unit: V */
    float32 param_rated_voltage;/* unit: V */
    float32 param_rated_current;/* unit: A */
    float32 param_maximum_holding_torque;/* unit: m*Nm */

    // float32 Ke_rating;/* unit: Vrms/(rad/s) */
    float32 Vbemf;/* unit: V */

    /* private data */
    
    /* public method */
    void (*ConfigParam)(struct StepperMotor *self);
    uint8 (*Init)(struct StepperMotor *self);
    
    /* private method */
    
} StepperMotor;

/* Variable Declare ***********************************************************/

/* Inline Function Define *****************************************************/

/* Function Declare ***********************************************************/
uint8 StepperMotor_Init(StepperMotor *self);



#endif